Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Making a call to an AppServer
The code next checks the toggle box in the window that signals whether to retrieve the temp-table data from a separate AppServer session. A discussion of the details of how to use the OpenEdge AppServer is beyond the scope of this book, but this one example gives you a flavor of how straightforward it is to separate your client session from an AppServer session on another machine where the database is connected.
If the AppServer toggle box is set, the procedure creates an AppServer object, which has a handle like any other Progress object, and uses it to connect to the AppServer:
The local hostname, server port number, and AppService name that are the parameters to the
CONNECTmethod are the defaults for connecting to a local AppServer session for testing purposes.If the AppServer flag was not set, then the procedure sets the
hAppServer variable to be the handle of the local session:
This signals OpenEdge that there is no AppServer running, but that all requests to this AppServer handle should just be run within the local session.
Then any
RUNstatement, such as the following, can run a procedureON SERVER hAppServer and have it run identically, whether there is really a separate AppServer session or not:
As you can see, running a procedure on an AppServer is just like running it within your session, except for the
ON SERVERsyntax. Even with this syntax, you can run the same procedure locally with no change to your code whatsoever, just by usingSESSION:HANDLEas the alternative value for the server handle.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |